<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>1</button>
    <button>2</button>
    <script>
        // let arr = [7, 65, 91, 26, 49, 88];
        // var res = Math.max.apply(Math, arr);
        // console.log(res);
        // let resu = Math.min.apply(Math, arr);
        // console.log(resu);
        var btns = document.querySelectorAll("button");
        for (let i = 0; i < btns.length; i++) {
            btns[i].addEventListener("click", function () {
                this.disabled = true;
                setTimeout(function () {
                    this.disabled = false;
                }.bind(this), 2000)
            })
        }
        // btns.forEach(function (val) {
        //     val.addEventListener("click", function () {
        //         this.disabled = true;
        //         setTimeout(function () {
        //             val.disabled = false;
        //         }, 2000)
        //     })
        // })
    </script>
</body>

</html>